//
//  ActivityViewController.swift
//  SwiftDemo
//
//  Created by Jason on 15/11/5.
//  Copyright © 2015年 Jason Jiang. All rights reserved.
//

import UIKit

class ActivityViewController: UIViewController {

    override func viewDidLoad() {
        super.viewDidLoad()

        // Do any additionvarsetup after loading the view.
        

        
        
    }
    
    override func viewDidAppear(animated: Bool) {
        
        super.viewDidAppear(animated)
        
        let str = "www.baidu.com"
        let url = NSURL(string: str)
        let img:UIImage! = UIImage (named: "1.png")
        
        let bookActivity = BookActivity ()
        bookActivity.block = {
            
            let imgVC = ImagePickerViewController()
            self.navigationController?.pushViewController(imgVC, animated: true);
            
        }
        
        let activityVC = UIActivityViewController (activityItems: [str,url!,img], applicationActivities: [bookActivity])
        
        
        self.presentViewController(activityVC, animated: true) { () -> Void in
            
        }
        
    }

    override func didReceiveMemoryWarning() {
        super.didReceiveMemoryWarning()
        // Dispose of any resources that can be recreated.
    }
    

    /*
    // MARK: - Navigation

    // In a storyboard-based application, you will often want to do a little preparation before navigation
    override func prepareForSegue(segue: UIStoryboardSegue, sender: AnyObject?) {
        // Get the new view controller using segue.destinationViewController.
        // Pass the selected object to the new view controller.
    }
    */

}
